package com.lokyiu.tutorial.java.exerisce4;

import java.util.ArrayList;
import java.util.List;

public class ClassGenarator {
	private List<Class> classes;

	public ClassGenarator(List<Student> students){
		List<Class> classes = new ArrayList<Class>();
		List<Student> studs = new ArrayList<Student>();
		for(int i=1;i<=5;i++){
			Class newClass = new Class();
			newClass.setClassId("C"+String.valueOf(i));
			for(Student st:studs){
				if(st.getClassId().equals(newClass.getClassId())){
					studs.add(st);
				}
				newClass.setStudents(studs);
			}
			
			classes.add(newClass);
		}
		this.setClasses(classes);
	}

	public List<Class> getClasses() {
		return classes;
	}

	public void setClasses(List<Class> classes) {
		this.classes = classes;
	}
}
